<template>
	<view class="common-container">
		<view class="status_bar"> </view>
		<view class="box-bg">
			<uni-nav-bar shadow  title="通讯录" />
		</view>
		<view v-for="(val,key) in users">
			<uni-section :title="key.toUpperCase()" type="line"></uni-section>
			<view v-for="item of val">
				<uni-list-chat :title="item.realName" :avatar="constants.getFileView(item.avatar)" :note="item.job | dictFormat" :time="item.mobile" ></uni-list-chat>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				users:{}
			}
		},
		onLoad() {
			this.fetchData()
		},
		created() {
		},
		methods: {
			fetchData(){
				this.$store.dispatch('userList').then((res)=>{
					this.users=res
				})
			}
		}
	}
</script>

<style>

</style>
